{% extends 'base.html' %}
{% block title %}Job list{% endblock %}

{% block content %}
<h1>Job list</h1>
{% if enable_add_job %}
    <a href="{% url jobs.views.add_job %}">Create job</a>
{% else %}
    {% if user.is_authenticated %}
        <a href="{% url jobs.views.add_and_associate_company %}">Looking for employees?</a>
    {% endif %}
{% endif %}
<ul>
  {% for job in object_list %}
    <li>
      <a href="{% url jobs.views.show_job key=job.key %}">{{ job.name }} @ {{ job.company }}</a> 
      {% ifequal job.company company %}
        | <a href="{% url jobs.views.edit_job key=job.key %}">Edit</a>
        | <a href="{% url jobs.views.delete_job key=job.key %}">Delete</a>
      {% endifequal %}
    </li>
  {% endfor %}
</ul>

<div>
  {% if has_previous %}
    <a href="{% url jobs.views.list_jobs %}?page={{ previous }}">&lt;-previous</a>
  {% endif %}
  {% if has_next %}
    <a href="{% url jobs.views.list_jobs %}?page={{ next }}">next-&gt;</a>
  {% endif %}
</div>
{% endblock %}
